<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('订单名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-order_name" data-rule="required" class="form-control" name="row[order_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('客户名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-customer_name" data-rule="required" class="form-control" name="row[customer_name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('客户电话')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-customer_phone" class="form-control" name="row[customer_phone]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('交货时间')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-delivery_time" class="form-control" name="row[delivery_time]" type="date" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('备注')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-remark" class="form-control" name="row[remark]" rows="3"></textarea>
        </div>
    </div>
    
    <!-- 自定义字段 -->
    {if isset($customFieldsHtml) && $customFieldsHtml}
    {:htmlspecialchars_decode($customFieldsHtml)}
    {/if}
    
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('订单型号')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="table-responsive">
                <table class="table table-bordered" id="model-table">
                    <thead>
                        <tr>
                            <th>型号</th>
                            <th>数量</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="model-row">
                            <td>
                                <select class="form-control model-select" data-rule="required">
                                    <option value="">请选择型号</option>
                                    {foreach $modelList as $id => $name}
                                    <option value="{$id}">{$name}</option>
                                    {/foreach}
                                </select>
                            </td>
                            <td>
                                <input type="number" class="form-control quantity-input" min="1" value="1" data-rule="required;number">
                            </td>
                            <td>
                                <button type="button" class="btn btn-danger btn-sm remove-row">删除</button>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <button type="button" class="btn btn-success btn-sm" id="add-model-row">添加型号</button>
            </div>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form> 